package com.waitingresult.zuo.sort;

/**
 * @Author: WangShuai
 * @CreateTime: 2022-10-24  13:32
 * @Description: 冒泡排序
 * @Version: 1.0
 */
public class BubblingSort {
    public static void main(String[] args) {
        int[] arr = {70,2,12,4,463,678,8,9,33,6};
        sort(arr);

    }
    public static void sort(int[] arr){
        for (int i = 0; i < arr.length; i++) {
            for (int i1 = i+1; i1 < arr.length; i1++) {
                if(arr[i] > arr[i1]){
                    SortUtils.swap(arr,i,i1);
                }
            }
        }
        SortUtils.print(arr);
    }
}
